package cn.edu.zafu.bigdata.bd121.studentdb.entity;

import java.util.Objects;

/**
 * 学生实体类
 *
 * @author 202211090121
 */
public class StudentPO {

    /**
     * 学生ID(主键)
     */
    private Long id;

    /**
     * 学生姓名
     */
    private String name;

    /**
     * 学生电话
     */
    private String phone;

    public StudentPO(Long id, String name, String phone) {
        this.id = id;
        this.name = name;
        this.phone = phone;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Override
    public String toString() {
        return "StudentPO{" +
                "id='" + id + '\'' +
                ", name='" + name + '\'' +
                ", phone=" + phone +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof StudentPO studentPo)) {
            return false;
        }
        return Objects.equals(getPhone(), studentPo.getPhone()) && Objects.equals(getId(), studentPo.getId()) && Objects.equals(getName(), studentPo.getName());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getId(), getName(), getPhone());
    }
}
